# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=openxr
pkgver=1.1.36
pkgrel=0
pkgdesc="OpenXR loader library"
url="https://khronos.org/openxr"
arch="all"
license="Apache-2.0"
makedepends="cmake mesa-dev vulkan-loader-dev jsoncpp-dev samurai wayland-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/KhronosGroup/OpenXR-SDK/archive/release-$pkgver.tar.gz"
builddir="$srcdir/OpenXR-SDK-release-$pkgver"
options="!check" # no check available

build() {
	case "$CARCH" in
		armhf)
			export CXXFLAGS="$CXXFLAGS -D_M_ARM" ;;
	esac

	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=Release
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
88b2c903991723634ab9bcf71e4c7856397427048db6b710332f43d8185a8aa2c22a9769f2fc7c7d5c6ab5c5b31b3e9c6d1302b9b8935293cef3a1029a80c888  openxr-1.1.36.tar.gz
"
